﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="randomhouseleft.ascx.cs" Inherits="WebHousingInfo.Controls.randomhouseleft" %>
<div id="news_nhadat_250">
    <div class="title">TIN TỨC NHÀ ĐẤT NGẪU NHIÊN</div>
    <div class="content">
    <%  var objectNewsHouse = HousingInfo.Library.NewsHouseBOList.GetFiveNewsHouse_ByNumber(5);
      foreach (var obNewsHouse in objectNewsHouse)
      {
          if (obNewsHouse.IsActive == true)
          { %>
        <div class="data clearfix">
	        <% if (obNewsHouse.UrlImage != "")
            {
                var listimage = obNewsHouse.UrlImage.Split('/');
                string url = "";
                foreach (var detail in listimage)
                {
                    if (checkurlimage(detail) == true)
                    {
                        url = "TotalUpload/ImagesTotal/" + detail;                                    
                                
                            
                         %><a href="TinNhaDatChiTiet.aspx?id=<%=obNewsHouse.NewsHouseID %>"><img src="<%=url %>" width="80" height="70" border="0" align="left" /></a><% break;
                    }
                }
                if (url == "")
                { %><a href="TinNhaDatChiTiet.aspx?id=<%=obNewsHouse.NewsHouseID %>"><img src="TotalUpload/ImagesTotal/noimage.gif" width="80" height="70" border="0" align="left" /></a>
                <% }
            }
            else
            { %>
                <a href="TinNhaDatChiTiet.aspx?id=<%=obNewsHouse.NewsHouseID %>"><img src="TotalUpload/ImagesTotal/noimage.gif" width="80" height="70" border="0" align="left" /></a>
            <%} %>
	        <p><a href="TinNhaDatChiTiet.aspx?id=<%=obNewsHouse.NewsHouseID %>"><%=obNewsHouse.Title%></a></p>
	        <% if(obNewsHouse.NewsContent.Length > 85)
            {%>
                <%=obNewsHouse.NewsContent.Substring(0,75)%> ...
            <%}
            else
            {%>
             <%=obNewsHouse.NewsContent%>
            <%} %>
        </div>
        <div class="line"></div>
        <%}
      } %>
        
    </div>
    <div class="footer"><a href="TatCaTinNhaDat.aspx">Xem thêm</a></div>		
</div>